﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.WebNemo.Data {
    public struct FromGroup {

        public int GroupId;
        public string TableName;
        public string GroupType;
        public FromGroupRelation Relation;
        public int LimitToIdx;

        public FromGroup(int groupId, string tableName, string groupType)
            : this(groupId, tableName, groupType, "", "", "") { }

        public FromGroup(int groupId, string tableName, string groupType, string joinTableName, string joinParentColumnName, string joinColumnName) {
            this.GroupId = groupId;
            this.TableName = tableName;
            this.GroupType = groupType;
            this.Relation = new FromGroupRelation(joinColumnName, joinTableName, joinParentColumnName);
            this.LimitToIdx = 0;
        }
    }

    public struct FromGroupRelation {

        public string ParentTableName;
        public string ParentColumnName;
        public string ColumnName;

        public FromGroupRelation(string columnName, string parentTableName, string parentColumnName) {
            this.ParentTableName = parentTableName;
            this.ParentColumnName = parentColumnName;
            this.ColumnName = columnName;
        }

    }
}
